//
// Created by DengLibin on 2019/1/31 0031.
//

#ifndef WXWIDGETS_PRODUCTOR_H
#define WXWIDGETS_PRODUCTOR_H
#include <wx/thread.h>
#include <iostream>
#include <vector>
using namespace std;

/**
 * 生产者线程
 */
class Producer : public wxThread {
private:
    wxMutex * mutex; //互斥锁
    wxCondition * condition; //条件变量
    vector<int> * buf; // 缓存池
    int bufSize = 0;//缓冲池大小
    int productNum = 0;//生产元素个数

public:
    Producer( wxMutex * mutex, wxCondition * condition, vector<int> * buf, int bufSize);
    //生产
    void * Entry() HAVE_OVERRIDE;
};


#endif //WXWIDGETS_PRODUCTOR_H
